GetAxesStatus
获取选定轴线的状态。
语法
KsError GetAxesStatus(
int Length,
int* Indexes,
AxisStatus* States
);
参数
Length [in]:轴的数量。
Indexes [in]:轴索引之阵列,索引以零为起点;别名将影响此参数。
States [out]:将接收轴状态的 AxisStatus 阵列类型。
回传值
如果此函式执行成功,会回传 errNoError
,否则会传回错误码。如需更多有关错误码的资讯,请参阅 KsError 清单。
备注
当模数轴启用时,模数值会套用至 McSource 中的 Commend、Set 及 Actual 位置。
范例
复制
AxisStatus axesStatus[4] = { {0} };
int axesIdx[4] = { 0, 2, 4, 6 };
KsError nRet = GetAxesStatus(4, axesIdx, axesStatus);
for (int i = 0; i < 4; i++)
{
RtPrintf("Axis %d State: %d MotionError: 0X%x\n", i, axesStatus[i].State, axesStatus[i].MotionError);
}
使用需求
RT | Win32 | |
---|---|---|
最低支援版本 | 4.2 | 4.2 |
标头档 | ksmotion.h | ksmotion.h |
程式库 | KsApi_Rtss.lib | KsApi.lib |
参见